package com.woniu.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.common.dto.CouponStatusDTO;
import com.woniu.common.utils.ResponseData;
import com.woniu.product.pojo.CouponStatus;
import com.woniu.product.service.CouponStatusService;
import com.woniu.product.mapper.CouponStatusMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* @author ltyipx
* @description 针对表【coupon_status】的数据库操作Service实现
* @createDate 2024-08-06 14:17:02
*/
@Service
public class CouponStatusServiceImpl extends ServiceImpl<CouponStatusMapper, CouponStatus>
    implements CouponStatusService{

    @Autowired
    private CouponStatusMapper couponStatusMapper;
    @Override
    public CouponStatus ifHave(String couponId, String userId) {

        return couponStatusMapper.ifHave(couponId,userId);
    }

    @Override
    public ResponseData<?> queryCouponById(String id) {
        CouponStatusDTO couponStatusDTO = couponStatusMapper.queryCouponById(id);
        return new ResponseData<>().success(couponStatusDTO);
    }
}




